<h2>Categor&iacute;as</h2>

<div class="row span12"><a class="btn btn-primary" href="index.php?module=categories&submodule=new">Agregar nueva categor&iacute;a</a></div>

<table class="table table-striped">
	<thead>
	<tr>
		<th>#</th>
		<th>Nombre</th>
		<th>Libros</th>
		<th></th>
	</tr>
	</thead>
	<tbody>
<?php $i=0;foreach($categories as $row):?>
	<tr>
		<td><?php echo ++$i;?></td>
		<td><a href='index.php?module=books&categories_id=<?php echo $row['id'];?>'><?php echo $row['name'];?></a></td>
		<td><?php echo $row['qty_books'];?></td>
		<td><a class="btn btn-primary" href="index.php?module=categories&submodule=edit&id=<?php echo $row['id'];?>">Editar</a>&nbsp;<a class="btn btn-danger" onclick="if(!confirm('Eliminar esta categor&iacute;a?')) return false;" href="index.php?module=categories&action=delete&id=<?php echo $row['id'];?>">Eliminar</a></td>
	</tr>
<?php endforeach;?>
	</tbody>
</table>
